// routes/shopRoutes_diagnostic.js
const express = require('express');
const router = express.Router();

// 直接导入控制器并检查
console.log('开始导入控制器...');
try {
  const shopController = require('../controllers/shopController');
  console.log('控制器导入成功:', Object.keys(shopController));
  console.log('getShops 类型:', typeof shopController.getShops);
  console.log('getShopById 类型:', typeof shopController.getShopById);
} catch (error) {
  console.error('控制器导入失败:', error.message);
}

// 临时绕过认证的路由
router.get('/', (req, res) => {
  res.json({
    success: true,
    message: '诊断路由 - 餐厅列表接口正常',
    timestamp: new Date().toISOString()
  });
});

router.get('/:id', (req, res) => {
  res.json({
    success: true,
    message: `诊断路由 - 获取餐厅 ${req.params.id} 详情`,
    timestamp: new Date().toISOString()
  });
});

module.exports = router;